import React, { useEffect, useState } from 'react';

const DateTimeDisplay = () => {
  const [currentTime, setCurrentTime] = useState(new Date());

  useEffect(() => {
    const timer = setInterval(() => {
      setCurrentTime(new Date());
    }, 1000);

    return () => clearInterval(timer);
  }, []);

  return (
    <div style={{ color: 'black', textAlign: 'right', padding: '10px', fontSize: '20px', fontWeight: 'bold' }}>
      {currentTime.toLocaleString('zh-CN', { hour12: false })}
    </div>
  );
};

export default DateTimeDisplay; 